﻿namespace VisualWip.Core.Columns
{
    public class ImageColumn : Column
    {
        private string _imagePath;

        public ImageColumn()
        {
            Height = 300;
            Width = 300;
            PositionY = 0;
            ShowBorder = false;
            ShowHeader = false;

        }

        public string ImagePath
        {
            get { return _imagePath; }
            set
            {
                if (value != _imagePath)
                {
                    _imagePath = value;
                    OnPropertyChanged(this, () => ImagePath);
                }
            }
        }

        public override PersistenceTree Persist(string name)
        {
            PersistenceTree settings = base.Persist(name);
            settings.Add(() => ImagePath);
            return settings;
        }

        public override void Load(PersistenceTree settings)
        {
            base.Load(settings);
            ImagePath = settings.Get(() => ImagePath,string.Empty);
        }

        public override void DoRefresh()
        {
        }
    }
}